package pay;
//20230404430920沈泽华
public class Graduate implements StudentInterface,TeachInterface {
   String name;//姓名
   String gender;//性别
   int age;//年龄
   int fee;//学费
   int pay;//工资

   public Graduate(String name,String gender,int age,int fee, int pay){
       this.name = name;
       this.gender = gender;
       this.age = age;
       this.fee = fee;
       this.pay = pay;
   }//构造方法，接收数据
    @Override
    public int getPay() {
        return pay;
    }
    @Override
    public void setPay(int pay) {
        this.pay = pay;
    }
    @Override
    public int getFee() {
        return fee;
    }
    @Override
    public void setFee(int fee) {
         this.fee = fee;
    }

    public void introduction(){
        System.out.println("你是"+name+",性别:"+gender+",年龄:"+age+",工资:"+getFee()+",学费:"+getPay());
    }

    public void loanStatus(){
       int year_pay = this.pay * 12;
       int year_fee = this.fee * 2;
       int difference = year_pay - year_fee;

       if(year_pay >= year_fee)
           System.out.println("年收入可以支付起两学期的学费");
       else if (year_pay < year_fee && difference < 2000) {
           System.out.println("年收入无法支付起两学期的学费，而且需要贷款。");
       } else if (year_pay < year_fee && difference >= 2000) {
           System.out.println("年收入无法支付起两学期的学费，但是不需要贷款");
       }
    }//判断方法体，判断能否支付学费并需不需要贷款
}
